package com.qiyuexinxi.chat.dto.request;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * @author yangxingyu
 * @date 2020/2/27
 * @description
 */
@ApiModel("注册用户")
@Data
public class RegisterRequest {

    @ApiModelProperty("手机号")
    @NotEmpty(message = "手机号不能为空")
    @Pattern(regexp = "^((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-8])|(18[0-9])|166|198|199|(147))\\d{8}$", message = "手机号格式错误")
    private String phone;

    @ApiModelProperty("登录密码")
    @NotEmpty(message = "登录密码不能为空")
    @Size(min = 8, max = 500, message = "登录密码不能少于8位")
    private String password;

    @ApiModelProperty("手机验证码")
    @NotEmpty(message = "手机验证码不能为空")
    @Pattern(regexp = "^\\d{4}$", message = "验证码格式错误")
    private String phoneCode;

}
